package com.starleague.battletech.unit;

import java.util.Map;

import com.starleague.common.AbstractHasInfoProperties;

public abstract class AbstractBattletechUnitComponent
        extends AbstractHasInfoProperties
        implements IBattletechUnitComponent
{
    private AbstractBattletechUnit battletechUnit;
    private AbstractWeight weight;

    protected AbstractBattletechUnitComponent(AbstractBattletechUnit battletechUnit,
                                              AbstractWeight weight)
    {
        this.battletechUnit = battletechUnit;
        this.weight = weight;
    }

    protected AbstractBattletechUnitComponent()
    {
        //
    }

    protected AbstractBattletechUnit getBattletechUnit()
    {
        return this.battletechUnit;
    }

    @Override
    public AbstractWeight getWeight()
    {
        return this.weight;
    }

    @Override
    public int numHits()
    {
        // TODO
        return 0;
    }

    @Override
    public Map<String, Object> infoProperties()
    {
        Map<String, Object> infoPropertyMap = super.infoProperties();
        infoPropertyMap.put("weight", this.weight);
        infoPropertyMap.put("isHittable", this.isHittable());
        return infoPropertyMap;
    }
}
